import * as Echarts from "echarts";
export default {
    width: '835px',
    height: '250px',
    legend: {
        orient: 'horizontal',
        x: 'center',
        y: 'top',
        data: ['expected', 'actual']
    },
    grid: {
        left: '0',
        right: '30%',
        bottom: '0%',
        top: '10%',
        containLabel: true
    },
    tooltip: {
        trigger: 'axis',
        backgroundColor: 'rgba(149,149,149,0.8)',

        axisPointer: {
            type: 'cross'
        },
        textStyle: {
            color: 'white',
        }
    },
    xAxis: {
        type: 'category',
        boundaryGap: false, // 将此属性设置为false即可让其在两侧显示
        data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
        axisTick: {
            alignWithLabel: true,
            length: 0
        },

        axisLine: {
            lineStyle: {
                color: '#008acd',
                width: 1,
                type: 'solid'
            }
        },

    },
    yAxis: {
        type: 'value',
        axisLine: {
            show: true,
            lineStyle: {
                color: '#008acd',
                width: 1,
                type: 'solid'
            }
        },
        axisLabel: {
            show: true, // 是否显示
            margin: 10, // 刻度标签与轴线之间的距离
            color: '#008acd' // 默认轴线的颜色
        }
    },
    series: [{
            symbolSize: 3, //线上面小圆点大小
            name: 'expected',
            data: [200, 192, 120, 144, 160, 130, 140],
            type: 'line',
            smooth: true
        },
        {
            symbolSize: 3, //线上面小圆点大小
            name: 'actual',
            data: [180, 160, 151, 106, 145, 150, 130],
            type: 'line',
            smooth: true,
            //线条样式 
            areaStyle: {
                normal: {
                    //颜色渐变函数 前四个参数分别表示四个位置依次为左、下、右、上
                    color: new Echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                        offset: 1,
                        color: 'rgba(245,248,253,1)'
                    }])

                }
            },
        }

    ],
    color: ['#ff005a', '#3888fa']
};